<template>
    <div id="company">
        <div id="company-chose">
            <div class="company-locate">
                <p class="chose-title">公司地点：</p>
                <p class="locate-city">福州</p>
                <img src="../assets/profession/右.png" alt="">
                <ul class="chose-list">
                         <li v-for="(a,index) in areaList" :key="a"
                         @click="aIndexChange(a,index)"
                         :class="{nolimit:areaIndex==index}">
                             {{a}}
                         </li>
                         <!-- <li class="disabled">永泰县</li>
                         <li class="disabled">罗源县</li> -->
                     </ul>
            </div>
            <div class="company-locate">
                <!-- <p class="chose-title">行业类型：</p> -->
                <ul class="chose-list">
                    <p class="chose-title">行业类型：</p>
                    <li v-for="(j,index) in jobTypeList" :key="j"
                    @click="jTypeIndexChange(index)"
                    :class="{nolimit:jobTypeIndex==index}">
                        {{j}}
                    </li>
                </ul>
            </div>
            <div class="company-locate">
                <p class="chose-title">融资阶段：</p>
                <ul class="chose-list">
                    <li v-for="(i,index) in investList" :key="i"
                    @click="investIndexChange(index)"
                    :class="{nolimit:iIndex==index}">
                        {{i}}
                    </li>
                </ul>
            </div>
            <div class="company-locate">
                <p class="chose-title">工司规模：</p>
                <ul class="chose-list">
                    <li v-for="(c,index) in cScaleList" :key="c"
                    @click="cIndexChange(index)"
                    :class="{nolimit:cIndex==index}">
                        {{c}}
                    </li>
                </ul>
            </div>
        </div>
        <div id="companybody">
            <companyList :companycheck="companycheck"></companyList>
        </div>
    </div>
</template>
<style>
#company{
    box-shadow:inset 0px 15px 10px -15px rgb(184, 182, 182); 
}

#company-chose{
    width: 1184px;
    margin:0 auto;
    padding-bottom: 24px;
    box-sizing: border-box;
}

#company-chose .company-locate{
    padding:6px 0;
    position: relative;
    border-bottom: 1px solid #e2e3e4;
}

#company-chose .company-locate img{
    width: 16px;
    position: absolute;
    top: 20px;
    left: 112px;
}

#company-chose .chose-title{
    color: #273B4E;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    margin-right: 12px;
}

#company-chose .locate-city{
    font-size: 12px;
    color: #646A7E;
    display: inline-block !important;
    margin-right: 48px;
}

#company-chose .nolimit{
    color: #1958FB !important;
    /* font-size: 12px;
    display: inline-block;
    margin-right: 24px; */
}

#company-chose .chose-list{
    padding-top: 10px;
}

#company-chose .chose-list li{
    font-size: 12px;
    color: #646A7E;
    margin: 0 12px 20px 0;
}

.disabled{
    color: #99A0AB !important;
}
</style>
<script>
import companyList from './company/companyList.vue'
export default {
    name:'company',
    components:{
        'companyList':companyList
    },
    data() {
        return {
            areaIndex:0,
            jobTypeIndex:0,
            iIndex:0,
            cIndex:0,
            areaList:[
                "不限","仓山区","鼓楼区","台江区","马尾区","晋安区",
                "闽侯县","连江县","闽清县","平潭县","福清市","长乐市",
                "永泰县","罗源县"
            ],
            jobTypeList:["不限","互联网","人工智能","金融","电子商务","游戏","媒体","广告营销",
            "数据服务","医疗健康","生活服务","旅游","在线教育","社交网络","人力资源服务",
            "企业服务","信息安全","智能硬件","移动互联网","物联网","软件开发","区块链","通讯电子",
            "物流运输","工具","计算机软件","制造业","通信"],
            tradeId:["1271631822123569151","1271631822123569152","1271631822123569153","1283300225536102400",
            "1283300241952608256","1283300257865797632","1283300310172962816","1283300448014569472",
            "1283300473184587776","1283300491660496896","1283300525789548544","1283300909371232256",
            "1283300940597825536","1283300968632553472","1283300987116851200","1283301002581250048",
            "1283301062253613056","1283301163445391360","1283304390559666176","1283304465256026112",
            "1283304724162023424","1283304788179685376","1283305687031615488","1283305856263393280",
            "1321024813145530368","1330836885282758656","1372798939266555904"],
            investList:["不限","不需要融资","A轮","B轮","C轮","D轮以上","已上市","不需要融资"],
            cScaleList:["不限","0-20人","20-99人","100-499人","500-999人",
            "1000-9999人","100000人以上"],
            companycheck:{
                areaId: null,
                financeIdList: [],
                scaleIdList: [],
                tradeIdList: []
            }
        }
    },
    methods: {
        aIndexChange(a,index){
            this.areaIndex = index;
            switch(a){
                case '不限':
                    this.companycheck.areaId = null;
                    break;
                case '仓山区':
                    this.companycheck.areaId = '350104';
                    break;
                case '鼓楼区':
                    this.companycheck.areaId = '350102';
                    break;
                case '台江区':
                    this.companycheck.areaId = '350103';
                    break;
                case '马尾区':
                    this.companycheck.areaId = '350105';
                    break;
                case '晋安区':
                    this.companycheck.areaId = '350111';
                    break;
                case '闽侯县':
                    this.companycheck.areaId = '350121';
                    break;
                case '长乐市':
                    this.companycheck.areaId = '350112';
                    break;
                case '连江县':
                    this.companycheck.areaId = '350122';
                    break;
                case '罗源县':
                    this.companycheck.areaId = '350123';
                    break;
                case '闽清县':
                    this.companycheck.areaId = '350124';
                    break;
                case '永泰县':
                    this.companycheck.areaId = '350125';
                    break;
                case '闽清县':
                    this.companycheck.areaId = '350126';
                    break;
                case '闽清县':
                    this.companycheck.areaId = '350127';
                    break;
                default:
                    this.companycheck.areaId = '';
                    break;
            }
            //指定跳转地址
            // this.$router.replace('/company/cempty');
        },
        jTypeIndexChange(index){
            this.jobTypeIndex = index;
            if(index != 0){
                this.companycheck.tradeIdList[0] = this.tradeId[index];
            }
            else{
                this.companycheck.tradeIdList = []
            }
        },
        investIndexChange(index){
            this.iIndex = index;
            if(index != 0){
                this.companycheck.financeIdList[0] = "" + index
                console.log(this.companycheck.financeIdList)
            }
            else{
                this.companycheck.financeIdList = []
            }
        },
        cIndexChange(index){
            this.cIndex = index;
            if(index != 0){
                this.companycheck.scaleIdList[0] = "" + index
                console.log(this.companycheck.scaleIdList[0])
            }
            else{
                this.companycheck.scaleIdList = []
            }
        }
    },
}
</script>